//
//  GZTaskStateButton.m
//  ocDemo
//
//  Created by Joggy on 16/5/4.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "GZTaskStateButton.h"

@implementation GZTaskStateButton

-(instancetype)initWithTitle:(NSString *)title {
//    self = [super initWithFrame:CGRectMake(0, 0, TSWidth, TSHeight)];
    self = (GZTaskStateButton*)[UIButton buttonWithType:UIButtonTypeSystem];
    self.frame = CGRectMake(0, 0, TSWidth, TSHeight);
    self.layer.borderWidth = 1;
    self.layer.borderColor = [UIColor colorWithRed:1 green:127/255.0 blue:1/255.0 alpha:1].CGColor;
    self.layer.cornerRadius = 3;
    _title = title;
    [self setAttributedTitle:[[NSAttributedString alloc] initWithString:_title attributes:@{NSForegroundColorAttributeName: [UIColor colorWithRed:1 green:127/255.0 blue:1/255.0 alpha:1], NSFontAttributeName: [UIFont systemFontOfSize:14]}] forState:UIControlStateNormal];
    return self;
}

-(void)reTitle:(NSString *)aTitle {
//    _title = newTitle;
    [self setAttributedTitle:[[NSAttributedString alloc] initWithString:aTitle attributes:@{NSForegroundColorAttributeName: [UIColor colorWithRed:1 green:127/255.0 blue:1/255.0 alpha:1], NSFontAttributeName: [UIFont systemFontOfSize:14]}] forState:UIControlStateNormal];
}

@end
